package com.xdf.whiteaccount.service.impl;

import com.xdf.whiteaccount.entity.BillDyeGrey;
import com.xdf.whiteaccount.entity.DyeGreyDetail;
import com.xdf.whiteaccount.entity.DyeGreyMain;
import com.xdf.whiteaccount.exception.BusinessException;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BillDyeGreyServiceChecker {
    public void isEmpty(BillDyeGrey record){
        if(record == null) throw new BusinessException("空数据无法保存！");
        DyeGreyMain main = record.getMain();
        if(main == null) throw new BusinessException("空数据无法保存！");
        List<DyeGreyDetail> detailList = record.getDetailList();
        if(detailList == null || detailList.size() == 0) throw new BusinessException("空数据无法保存！");
    }
}
